#pragma once

#include "../radar.h"
#include "VtsProtocol.h"
#include "../../common/timercpp.h"

#define VTSRADARSPOKES (3072)

class VtsRadar : public Radar
{
public:
    VtsRadar(boost::asio::io_service& io_service);
    virtual ~VtsRadar();

    virtual bool do_video_processer(const char *data, unsigned int length);
    virtual void StartOwnProcess();

    void SetMaxWave(unsigned int max_wave) { m_max_wave = max_wave; }
private:
    void onRadarSpoke(unsigned int bearing, const char *data, unsigned int length);
    void GetRadarState(VtsItemHeader *header);
    void SendHeartBeat();

    void convertData(float *data, unsigned int length);

    char m_old_range;

    Timer m_send_timer;

    std::string m_single_data;
    unsigned short m_current_bearing;

    char m_radar_buffer[VTSRADARSPOKES];

    unsigned int m_max_wave;
};